<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="wangyuguo">
		<title>选择角色</title>
		<script type="text/javascript" language="JavaScript" src="../script/common.js"></script>
		<script type="text/javascript" language="JavaScript" src="../script/tree.js"></script>
		<script type="text/javascript" language="JavaScript">
			var qt = null;
			var tree = null;
			var groupId = null;
			var cardTypes = null;
			function load() {
				var businessType = getPara('mainJudge')
				if (!businessType){
					alert("没有选择业务类型")
				}
				cardTypes = DWR.syncCall("cardMgntService.findCardTypes");
				
				var l = []
				for (var i=0;i<cardTypes.length;i++){
					var ct = cardTypes[i];
					if (checkCardType(businessType,ct))
						l.push(ct)
				}
				Common.initDict(ruleForm.cardType,l,"(不限制)","id","name");
			}
			//单位卡和个人卡
			function isPCCrd(ct){return ct.baseCardType == BaseCardType.PERSONAL || ct.baseCardType == BaseCardType.COMPANY}
			function checkCardType(bt,ct){
				if (bt == Constants.ACCOUNT_FEE_SELL_CARD || bt == Constants.ACCOUNT_FEE_RESET_PIN_CARD || bt == Constants.ACCOUNT_FEE_USE_PIN_CARD || bt == Constants.ACCOUNT_FOREGIFT_CARD){
					//售卡手续费,重置密码，启用停用密码,卡押金
					return isPCCrd(ct)
				}else if (bt == Constants.ACCOUNT_FEE_REVOCATE_CARD || bt == Constants.ACCOUNT_FEE_REPORTLOCK_CARD || bt == Constants.ACCOUNT_FEE_UNLOCK_CARD){
					//销户手续费,挂失手续费,解挂手续费
					return isPCCrd(ct) && !ct.anonymous
				}else if (bt == Constants.ACCOUNT_FEE_EXPIRED_CARD){//失效卡手续费
					return true
				}else if (bt == Constants.ACCOUNT_FEE_UPGRAD_ANON_CARD){//不记名卡升级手续费
					return ct.baseCardType == BaseCardType.PERSONAL && !ct.anonymous && ct.depositable
				}else if (bt == Constants.ACCOUNT_FEE_DRIVER_UPGRAD_CARD){//副卡升级手续费
					return ct.baseCardType == BaseCardType.COMPANY
				}else
					return false
			}
		
			function onSave() {
				if(!checkForm("ruleForm"))return;
				var obj = Common.getValues(ruleForm);
				if (!obj.cardType)
				{
					showInformation("至少需要输入一个判断条件")
					return
				}
				if (!obj.amount)
				{
					showInformation("请输入金额")
					return
				}
				
				obj.amount = Format.yuanToFen(obj.amount)
				dialogBackValue(obj);
			}
			
		
		</script>
	</head>
	<body class="body" onload="load()">
		
		<form id="ruleForm" name="ruleForm">
		
			<div class="form" >
				<div class="formTitle">判断条件</div>
		        <table cellSpacing="0" cellPadding="4" width="100%" border="0">
				
					<tr>	
						<td>
							<label>卡&nbsp;类&nbsp;别</label>
							<select name="cardType" ><option></option></select>
						</td>
					</tr>
					<!-- 
					<tr>	
						<td>
							<label>客户级别</label>
							<select name="cardUserLevel" ><option></option></select>
						</td>
					</tr>
					 -->
				</table>
			</div>
			
			<div class="form" >
				<div class="formTitle">执行结果</div>
				<table cellSpacing="0" cellPadding="4" width="100%" border="0">
				
					<tr>	
						<td>
							<label>金&nbsp;&nbsp;&nbsp;&nbsp;额</label>
							<input type="text" name="amount" maxlength="20" onblur="checkV(this,'amount',true)"/> 元<span class="des">*</span>
						</td>
					</tr>
				</table>
			</div>
		</form>

	</body>
</html>
